package wangjg.coco.views;

import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Text;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.layout.GridData;

public class LoginDialog {

	private Shell sShell = null;
	private Label lbUserName = null;
	private Text txtUserName = null;
	private Label lbPassword = null;
	private Text txtPassword = null;
	private Button btnOK = null;
	private Button btnCancel = null;

	public LoginDialog() {
		createSShell();
		sShell.open();
	}

	public Shell getSShell() {
		return sShell;
	}

	/**
	 * This method initializes sShell
	 */
	private void createSShell() {
		sShell = new Shell();

		GridData gridData = new GridData();
		gridData.horizontalSpan = 2;
		GridLayout gridLayout = new GridLayout();
		gridLayout.numColumns = 3;
		sShell.setText(" 用户登录 ");
		sShell.setLayout(gridLayout);
		sShell.setSize(new Point(300, 200));
		sShell.addShellListener(new org.eclipse.swt.events.ShellAdapter() {
			public void shellClosed(org.eclipse.swt.events.ShellEvent e) {
				sShell.dispose(); // TODO Auto-generated Event stub
									// shellClosed()
			}
		});
		lbUserName = new Label(sShell, SWT.NONE);
		lbUserName.setText(" 用户名： ");
		txtUserName = new Text(sShell, SWT.BORDER);
		txtUserName.setLayoutData(gridData);
		lbPassword = new Label(sShell, SWT.NONE);
		lbPassword.setText(" 密码： ");
		txtPassword = new Text(sShell, SWT.BORDER);
		Label filler1 = new Label(getSShell(), SWT.NONE);
		btnOK = new Button(getSShell(), SWT.NONE);
		btnOK.setText(" 确定 ");
		btnCancel = new Button(getSShell(), SWT.NONE);
		btnCancel.setText(" 取消 ");
	}

}